<%--
  Created by IntelliJ IDEA.
  User: 箜絔lk
  Date: 2020/9/28
  Time: 18:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>

<div id="sql"></div>
<script src="${path}/plugins/jquery/jquery.min.js">
</script>

<script>
    $(function(){
        let sql = "insert into tb_second_horizon_session values";
        $.get("https://www.easy-mock.com/mock/5f71c53071dad5156af748e0/movie/getAll",null,function(data){
            //console.log(data.data.book)
            let arr = data.data.user;
            for(let i=0;i<arr.length;i++){
                sql+="(";
                sql+=arr[i].session_id+",";
                sql+=arr[i].movie_id+",";
                sql+=arr[i].hall_id+",";
                sql+=arr[i].price+",";
                sql+="'"+arr[i].start_time+"'"+",";
                sql+="'"+arr[i].finish_time+"'"+",";
                sql+=arr[i].is_deleted+",";
                sql+="'"+arr[i].create_time+"'"+"),";
            };
            sql+=");<br>";
            $("#sql").html(sql);
        });

    })
</script>

</body>
</html>
